/*
 * Init.c
 *
 * Initialize the program. Currently just for testing the features of
 * the code that have been written.
 *
 *  Created on: June 23, 2011
 *      Authors: Lane Aasen, Nikholas Gaffney, Michael Rosenberger, Dylan Swiggett
 */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "vector3D.h"
#include "log.h"
#include "boidType.h"
#include "world.h"

int main() {

	initBoidTypes("main/btdl.txt");

	//initializing a BoidType to test with

	BoidType b;
	Color c;
	c.r = 0;
	c.g = 0;
	c.b = 0;
	b.density = 1;
	b.color = c;
	b.attrRadius = 14;
	b.attrStrength = .1;
	b.repelRadius = 10;
	b.repelStrength = .17;

	//initializing a world to test with

	World w = initWorld(
			initVector3D(0, 0, 0),
			0,
			-100, 100,
			-100, 100,
			-100, 100);

	//adding a boid to that world

	createBoidAndAddToWorld(
			&w,
			initVector3D(0, 1, 0),
			initVector3D(0, 0, 0),
			1,
			&b);

	//printf("Hello Human! I'm a .bin file. Thanks for executing me!");

	createBoidAndAddToWorld(
			&w,
			initVector3D(0, 0, 0),
			initVector3D(0, 0, 0),
			1,
			&b);

	//little test environment

	char input = ' ';
	while (input != 'e') {
	  tick(&w);
		//printf("\n----------------------------\n");
		//printf("Xpos: %f\nYpos: %f\nZpos: %f", w.root->value.location.x, w.root->value.location.y, w.root->value.location.z);
		input = getchar();
	}

	return 0;
}

